<template>
  <div style="padding: 10px">
        <el-button type="primary" @click="submit">提交</el-button>
  </div>
</template>

<script>
import exchange from '../insIn8/zh'
import { md5 } from '../utils/md5'

export default {
    name: 't6',
    data() {
        return {
            tableData: [],
        }
    },
    computed: {

    },
    watch: {
    },
    mounted() {
    },
    methods: {
        submit() {
            let obj = JSON.parse(JSON.stringify(exchange))
            console.log(Object.keys(obj))
            let appid = '20221117001457783'
            let appkey = 'Oo9OP0pjZqhf2pzQxcvy'
            Object.keys(obj).forEach((item) => {
                let rand = new Date().getTime()
                let sin = md5(appid + obj[item] + rand + appkey)
                this.axios.get(`/api/trans/vip/translate?q=${obj[item]}&from=zh&to=en&appid=${appid}&salt=${rand}&sign=${sin}`)
                .then((res) => {
                    console.log(res)
                })
            })
        },
    },
}
</script>

<style scoped>
</style>